package com.newsplatform.common;

/**
 * 系统常量
 * 
 * @author Logan.Li
 */
public class Constants {
    
    /**
     * JWT相关常量
     */
    public static final String JWT_SECRET = "newsplatform_jwt_secret_key_2024";
    public static final long JWT_EXPIRATION = 86400000L; // 24小时
    public static final String JWT_HEADER = "Authorization";
    public static final String JWT_PREFIX = "Bearer ";
    
    /**
     * 用户角色
     */
    public static final String ROLE_ADMIN = "ADMIN";
    public static final String ROLE_USER = "USER";
    
    /**
     * 新闻状态
     */
    public static final Integer NEWS_STATUS_DRAFT = 0;     // 草稿
    public static final Integer NEWS_STATUS_PUBLISHED = 1; // 已发布
    public static final Integer NEWS_STATUS_ARCHIVED = 2;  // 已归档
    
    /**
     * 缓存键前缀
     */
    public static final String CACHE_NEWS_PREFIX = "news:";
    public static final String CACHE_CATEGORY_PREFIX = "category:";
    public static final String CACHE_USER_PREFIX = "user:";
    
    /**
     * 分页默认值
     */
    public static final Integer DEFAULT_PAGE_SIZE = 10;
    public static final Integer DEFAULT_PAGE_NUM = 1;
    
}
